package com.aaa.examine.controller;


import com.aaa.entity.CheckResult;
import com.aaa.examine.service.CheckResultService;
import com.aaa.examine.vo.CheckVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;


/**
 * IntelliJ IDEA
 * CheckResultController
 * 好好学习天天练
 *结果
 * @author caojianbin
 * 2023/3/27
 */
@RestController
@RequestMapping("/examine/result")
public class CheckResultController {
   @Resource
    private CheckResultService checkResultService;
//患者检查结果
   @PostMapping("queryAll/{current}/{size}")
    public Result<IPage<CheckResult>> queryAll(
            @PathVariable Integer current,
            @PathVariable Integer size,
            @RequestBody CheckVo checkVo){
       return checkResultService.queryAll(current,size,checkVo);
   }
    //安排检查
    @GetMapping("addCheck")
    public Result<CheckResult> addCheck(CheckResult checkResult){
       return checkResultService.addCheck(checkResult);
    }
    //添加检查结果
    @PostMapping("/addPicture")
    public Result addPicture(@RequestBody CheckResult checkResult){
       return checkResultService.addPicture(checkResult);
    }

    /**
     * 上传图片
     */
    @PostMapping("uploadFile")
    public Result<String> uploadFile(HttpServletRequest request, MultipartFile file){
        return checkResultService.uploadFile(request,file);
    }
}


